-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add support for XREADGROUP CLAIM arg #3486
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
19e2d4b to
afc4947
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request adds support for Redis XREADGROUP CLAIM functionality, allowing the claiming of idle pending messages from a stream's Pending Entries List (PEL) with a configurable minimum idle time. The implementation introduces delivery metadata tracking for claimed entries.
- Adds
XReadArgs.claim()methods to specify minimum idle time for claiming entries - Introduces
ClaimedStreamMessageclass to carry metadata (milliseconds since last delivery and redelivery count) - Updates
StreamReadOutputto parse optional metadata fields from Redis responses - Adds comprehensive unit and integration tests
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 16 comments.
Show a summary per file
| File | Description |
|---|---|
| src/main/java/io/lettuce/core/XReadArgs.java | Adds claim() builder and instance methods to configure CLAIM min-idle-time parameter |
| src/main/java/io/lettuce/core/StreamMessage.java | Adds isClaimed() method to distinguish claimed entries from fresh ones |
| src/main/java/io/lettuce/core/ClaimedStreamMessage.java | New class extending StreamMessage to hold claim metadata (redelivery count and time since last delivery) |
| src/main/java/io/lettuce/core/output/StreamReadOutput.java | Updates output parser to handle optional metadata fields for claimed entries in both integer and bulk string formats |
| src/test/java/io/lettuce/core/output/StreamReadOutputUnitTests.java | Adds unit tests for parsing claimed entries with metadata in various formats |
| src/test/java/io/lettuce/core/XReadGroupClaimIntegrationTests.java | New integration test suite validating CLAIM behavior with real Redis server |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/test/java/io/lettuce/core/XReadGroupClaimIntegrationTests.java
Outdated
Show resolved
Hide resolved
src/test/java/io/lettuce/core/XReadGroupClaimIntegrationTests.java
Outdated
Show resolved
Hide resolved
tishun
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
tishun
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ship it!
see #3482